package com.wtwd.device.dao;


import com.wtwd.device.model.entity.SleepRecord;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author ljiong
 * @date 2021/09/02
 * @description
 */
@Mapper
public interface SleepRecordMapper {
    List<SleepRecord> getDaysSleepRecord(@Param("deviceId") Long deviceId, @Param("startTime") String startTime, @Param("endTime") String endTime);

    List<SleepRecord> getMonthSleepRecord(@Param("deviceId") Long deviceId,@Param("month") String month);

    SleepRecord getSleepRecordByDeviceIdAndTime(@Param("deviceId") Long deviceId,@Param("time") String time);

    Integer addSleepRecord(SleepRecord sleepRecord);

    Integer clearSleepRecordByDate(@Param("date") String date);

    Integer deleteSleepRecordByDeviceId(@Param("id") Long id);
}
